import java.util.Scanner;

public class Operation {
    Scanner sc = new Scanner(System.in);
    Password p=new Password();
    PasswordStrengthChecker psc=new PasswordStrengthChecker();
    PasswordGenerator pg=new PasswordGenerator();
    public  void work(){
        boolean flag=true;
        while(flag){
            menu_op();
            System.out.print("请输入选项序号：");
            int a= sc.nextInt();
            switch (a){
                case 1:
                   menu_top();
                    p.encrypt();
                    break;
                case 2:
                    menu_top();
                    p.decrypt();
                    break;
                case 3:
                    //判断强度
                    menu_top();
                    System.out.print("请输入密码：");
                    String password = sc.next();
                    psc.checkPassword(password);
                    break;
                case 4:
                    menu_top();
                    System.out.print("请输入密码长度：");
                    int passwordLength = sc.nextInt();
                    pg.lenth(passwordLength);
                    break;
                case 5:
                    flag=false;
                    break;
            }
        }
    }
    public void menu_op(){
        System.out.println("============================");
        System.out.println("    欢迎使用密码管理系统");
        System.out.println("============================");
        System.out.println("        请选择操作：");
        System.out.println("  1. 加密");
        System.out.println("  2. 解密");
        System.out.println("  3. 判断密码强度");
        System.out.println("  4. 密码生成");
        System.out.println("  5. 退出");
    }
    public void menu_top(){
        System.out.println("============================");
        System.out.println("    欢迎使用密码管理系统");
        System.out.println("============================");
    }
}
